const Base = require('./base.js');
module.exports = class extends Base {
	constructor(ctx) {
		super(ctx);
		this.address = this.model('store/address');
	}
	async indexAction() {
		if(this.isGet) {
			return this.display();
		}

		let posts = this.post();

		let where = {};
		if(!think.isEmpty(posts.name)){
			where.name = ['LIKE','%'+posts.name+'%'];
		}
		const data = await this.address.dataTable(posts, where);
		console.log(JSON.stringify(data))
		return this.json(data);
	}
	
};